# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pathmatch
pkgname=('python2-pathmatch' 'python-pathmatch')
_pkgname=pathmatch
pkgver=0.2.2
pkgrel=6
pkgdesc='Path matching utilities.'
arch=('any')
url='https://pypi.org/project/pathmatch/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('05a3ef00a5fc7c7053b017230315f32914deee0272f26cd29dd3f445eacaa8fd38fb98c99e45bb2aa452954630e36beb3dd7f554d10949b042589acd5fa1c161')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pathmatch() {
  depends=('python2' 'python2-six' 'python2-typing')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pathmatch() {
  depends=('python' 'python-six' 'python-typing')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

